function y = CreatePatternModel(para)
% returns a cell data type model

a = para(1);
b = para(2);
c = para(3);
d = para(4);
res = para(5);

% model = [];
% Master Rectangle/Square
% y = 0
mstRect(:,1,1) = 0:res:a;
mstRect(:,2,1) = 0;
% x = a
mstRect(:,1,2) = a;
mstRect(:,2,2) = 0:res:b;
% y = b
mstRect(:,1,3) = 0:res:a;
mstRect(:,2,3) = b;
% x = 0
mstRect(:,1,4) = 0;
mstRect(:,2,4) = 0:res:b;

% top lelf sub-square
% y = d
topL(:,1,1) = d:res:d+c;
topL(:,2,1) = d;
% x = d+c
topL(:,1,2) = d+c;
topL(:,2,2) = d:res:d+c;
% y = d+c
topL(:,1,3) = d:res:d+c;
topL(:,2,3) = d+c;
% x = d
topL(:,1,4) = d;
topL(:,2,4) = d:res:d+c;


% top right sub-square
% y = d
topR(:,1,1) = a-d-c:res:a-d;
topR(:,2,1) = d;
% x = a-d
topR(:,1,2) = a-d;
topR(:,2,2) = d:res:d+c;
% y = d+c
topR(:,1,3) = a-d-c:res:a-d;
topR(:,2,3) = d+c;
% x = a-d-c
topR(:,1,4) = a-d-c;
topR(:,2,4) = d:res:d+c;


% low right sub-square
% y = b-d-c
lowR(:,1,1) = a-d-c:res:a-d;
lowR(:,2,1) = b-d-c;
% x = a-d
lowR(:,1,2) = a-d;
lowR(:,2,2) = b-d-c:res:b-d;
% y = b-d
lowR(:,1,3) = a-d-c:res:a-d;
lowR(:,2,3) = b-d;
% x = a-d-c
lowR(:,1,4) = a-d-c;
lowR(:,2,4) = b-d-c:res:b-d;


% low lelf sub-square
% y = b-d-c
lowL(:,1,1) = d:res:d+c;
lowL(:,2,1) = b-d-c;
% x = d+c
lowL(:,1,2) = d+c;
lowL(:,2,2) = b-d-c:res:b-d;
% y = b-d
lowL(:,1,3) = d:res:d+c;
lowL(:,2,3) = b-d;
% x = d
lowL(:,1,4) = d;
lowL(:,2,4) = b-d-c:res:b-d;


model = {mstRect, topL, topR, lowR, lowL};

y = model;
end